<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>微信免挂小号设置</title>
	<link rel="stylesheet" href="<?=adminassets?>assets/pear/component/pear/css/pear.css" />
	<style>
	    .qr-message {
            font-size: 16px;
            color: #333;
            margin-bottom: 10px;
        }
        
        .qr-code {
            margin-bottom: 20px;
        }
        
        #Up_LoginQrcode img {
            width: 200px;
            height: 200px;
            border: 1px solid #ccc;
        }
	</style>
</head>
<body class="pear-container">
<?php if ($my == "list") : ?>
<div class="layui-card">
		<div class="layui-card-body">
			<blockquote class="layui-elem-quote">
				<h3>微信免挂小提示</h3>
				<p>下载微信店员小号监控框架插件->解压->打开微信站长监控->应用双击->填写域名->填写微信名字->登录微信->保存->运行挂钩。</p>
				<p>由于需要微信登录PC版的,手机上不能退出也不能切换账号,可以直接卸载微信,重下载然后登录其他微信号,也能保持在线(比较麻烦点)</p>
				<p>用户发送邀请连接的时候需手动接受(客户量大可以联系作者弄自动绑定[收费])</p><br>
				<div class="layui-input-item">
					<a style="margin-left: 15px;" href="https://gx.daoh.top/wxapp/dianyuan.zip" class="layui-btn layui-btn-sm layui-btn-normal">店员插件下载</a>
					<a href="https://gx.daoh.top/wxapp/wxapp.zip" class="layui-btn layui-btn-sm layui-btn-normal">微信安装包</a>
					<!--<a id="lookAtClon" class="layui-btn layui-btn-sm layui-btn-normal">点击查看云端店员监控</a>-->
				</div>
			</blockquote>

			<table id="news" lay-filter="news"></table>
		</div>
	</div>

	<script type="text/html" id="toolbar">
		<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
			<i class="layui-icon layui-icon-add-1"></i>
			新增
		</button>
		<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="force_bind">
			<i class="layui-icon layui-icon-add-1"></i>
			强制绑定
		</button>
	</script>

	<script type="text/html" id="status">
		<input type="checkbox" name="status" value="{{d.id}}" lay-skin="switch" lay-text="启用|禁用" lay-filter="status" {{# if(d.status==1){ }} checked {{# } }}>
	</script>

	<script type="text/html" id="options">
		<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i class="layui-icon layui-icon-edit"></i></button>
		<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i class="layui-icon layui-icon-delete"></i></button>
	</script>
<?php endif; ?>	
<?php if ($my == "add") : ?>
    <!-- 添加数据 -->
<form class="layui-form" action="">
	<div class="layui-form">
		<div class="mainBox">
			<div class="main-container">
				<div class="layui-form-item">
					<label class="layui-form-label">
						挂机方式
					</label>
					<div class="layui-input-block">
						<select name="mode">
							<option value="2">PC挂机</option>
						</select>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">
						微信账号
					</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" name="wx_user" placeholder="必填项" type="text" value="" />
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">
						微信昵称
					</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" name="wx_name" placeholder="必填项" type="text" value="" />
						<p>(名称要与微信里的完全符合,不要花里胡哨,不可重复,不可带图标或者特殊符号)</p>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">
						微信备注
					</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" name="beizhu" placeholder="可留空" type="text" value="" />
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">
						排序（越小越靠前）
					</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" name="sort" placeholder="必填项" type="text" value="50" />
					</div>
				</div>
			</div>
		</div>
		<div class="bottom">
			<div class="button-container">
				<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="addSave">
					<i class="layui-icon layui-icon-ok"></i>
					提交
				</button>
				<button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
					<i class="layui-icon layui-icon-refresh"></i>
					重置
				</button>
			</div>
		</div>
	</div>
</form>
<?php endif; ?>	
<?php if ($my == "edit") : ?>
<form class="layui-form" action="">
    <div class="layui-form">
    	<div class="mainBox">
    		<div class="main-container">
    			<input type="hidden" name="id" value="<?= $id ?>" />
    			<div class="layui-form-item">
    				<label class="layui-form-label">
    					微信账号
    				</label>
    				<div class="layui-input-block">
    					<input type="text" class="layui-input" name="wx_user" placeholder="必填项" value="<?= $row['wx_user'] ?>" />
    				</div>
    			</div>
    			<div class="layui-form-item">
    				<label class="layui-form-label">
    					微信昵称
    				</label>
    				<div class="layui-input-block">
    					<input type="text" class="layui-input" name="wx_name" placeholder="必填项" value="<?= $row['wx_name'] ?>" />
    					<p>(名称要与微信里的完全符合,不要花里胡哨,不可重复,不可带图标或者特殊符号)</p>
    				</div>
    			</div>
    			<div class="layui-form-item">
    				<label class="layui-form-label">
    					微信备注
    				</label>
    				<div class="layui-input-block">
    					<input type="text" class="layui-input" name="beizhu" placeholder="可留空"  value="<?= $row['beizhu'] ?>" />
    				</div>
    			</div>
    			<div class="layui-form-item">
    				<label class="layui-form-label">
    					排序（越小越靠前）
    				</label>
    				<div class="layui-input-block">
    					<input type="text" class="layui-input" name="sort" placeholder="必填项" value="<?= $row['sort'] ?>" />
    				</div>
    			</div>
    		</div>
    	</div>
    	<div class="bottom">
    		<div class="button-container">
    			<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="editSave">
    				<i class="layui-icon layui-icon-ok"></i>
    				提交
    			</button>
    			<button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
    				<i class="layui-icon layui-icon-refresh"></i>
    				重置
    			</button>
    		</div>
    	</div>
    </div>
</form>
<?php endif; ?>
<?php if ($my == "force_bind") : ?>
<form class="layui-form" action="">
    <div class="layui-card">
        <div class="layui-card-header">
            <i class="layui-icon layui-icon-link"></i> 强制绑定店员
        </div>
        <div class="layui-card-body">
            <div class="layui-form-item">
                <label class="layui-form-label required">用户收款名</label>
                <div class="layui-input-block">
                    <input type="text" 
                           name="wx_username" 
                           class="layui-input" 
                           lay-verify="required" 
                           lay-reqtext="用户收款名不能为空" 
                           placeholder="请输入用户收款名"
                           autocomplete="off">
                    <div class="layui-form-mid layui-word-aux">请确保输入的收款名与用户添加的微信名完全一致</div>
                </div>
            </div>
            
            <div class="layui-form-item">
                <label class="layui-form-label required">店员名称</label>
                <div class="layui-input-block">
                    <input type="text" 
                           name="wx_dyname" 
                           class="layui-input" 
                           lay-verify="required" 
                           lay-reqtext="店员名称不能为空" 
                           placeholder="请输入店员名称"
                           autocomplete="off">
                    <div class="layui-form-mid layui-word-aux">请输入需要绑定的店员微信昵称</div>
                </div>
            </div>
            
            <div class="layui-form-item text-center">
                <div class="layui-input-block" style="margin-left: 0; text-align: center;">
                    <button type="submit" 
                            class="layui-btn layui-btn-normal layui-btn-sm" 
                            lay-submit 
                            lay-filter="addforce_bind">
                        <i class="layui-icon layui-icon-ok"></i> 确认绑定
                    </button>
                    <button type="reset" 
                            class="layui-btn layui-btn-primary layui-btn-sm">
                        <i class="layui-icon layui-icon-refresh"></i> 重置
                    </button>
                </div>
            </div>
        </div>
    </div>
</form>

<style>
.layui-card {
    margin: 20px auto;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.layui-card-header {
    font-size: 16px;
    font-weight: bold;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.layui-card-header i {
    margin-right: 8px;
    color: #5FB878;
}

.layui-card-body {
    padding: 30px 20px;
}

.layui-form-item {
    margin-bottom: 25px;
}

.layui-input {
    height: 38px;
    line-height: 38px;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    padding: 0 15px;
    transition: all .3s;
}

.layui-input:hover, .layui-input:focus {
    border-color: #5FB878;
    box-shadow: 0 0 5px rgba(95,184,120,0.15);
}

.layui-form-label.required:before {
    content: "*";
    color: #ff4d4f;
    margin-right: 4px;
}

.layui-form-mid.layui-word-aux {
    color: #999;
    font-size: 12px;
    padding-top: 5px !important;
}

.layui-btn {
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    transition: all .3s;
}

.layui-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.layui-btn-normal {
    background-color: #5FB878;
}

.layui-btn-primary {
    border: 1px solid #ddd;
}

.layui-btn + .layui-btn {
    margin-left: 15px;
}
</style>
<?php endif; ?>
<script src="<?=adminassets?>assets/pear/component/layui/layui.js"></script>
<script src="<?=adminassets?>assets/pear/component/pear/pear.js"></script>
<script src="<?=adminassets?>assets/js/core_js/Wechat_Trumpet.js?v=<?=time()?>"></script>